<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>干扰分析参数管理</title>

<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/jquery-easyui-1.3.5/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/jquery-easyui-1.3.5/themes/icon.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery-easyui-1.3.5/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery-easyui-1.3.5/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/jquery-easyui-1.3.5/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript">

	getData1();
	
	function getData1(){
		var url = "${pageContext.request.contextPath}/interferencequery/interferenceconfig.do";  
		var data = {type:1};
		$.ajax({   type : "get",   async : true, //同步请求   
			url : url,   
			data : data,      
			dataType:"json",
			success:function(dates){
				//转为JSON对象
			var dataObj=JSON.stringify(dates); 
			var val = JSON.parse(dataObj);
			$('#infMinMinutes').val(val.infMinMinutes);
			$('#infMaxMinutes').val(val.infMaxMinutes);
			$('#minrxqual').val(val.minrxqual);
			$('#numofinfrxqual').val(val.numofinfrxqual);
			$('#minleisuretime').val(val.minleisuretime);
			$('#maxleisuretime').val(val.maxleisuretime);
		    $('#NotKPSTCHthreshold').val(val.NotKPSTCHthreshold);
			$('#KPSTCHthreshold').val(val.KPSTCHthreshold);
			$('#Onepointthreshold').val(val.Onepointthreshold);
			$('#Otherchannelthreshold').val(val.Otherchannelthreshold);
			$('#Servicelevel1').val(val.Servicelevel1);
			$('#Servicelevel2').val(val.Servicelevel2);
			$('#Servicelevel3').val(val.Servicelevel3);
			$('#Minimumlevel').val(val.Minimumlevel);
			$('#BCCH').val(val.BCCH);
			$('#TCH').val(val.TCH);
			$('#BLOCK').val(val.BLOCK);
			$('#INTERMODULATION').val(val.INTERMODULATION);
			$('#SPURIOUS').val(val.SPURIOUS);
			$('#OTHER').val(val.OTHER);
			},   
			error: function() {
				alert("获取数据失败，请稍后再试！");
			}  
			});   
	}
	function refresh1(){
		getData1();
	}
	
	function submitData1(){
		var type="^[0-9]*[0-9][0-9]*$";   //判断输入是否为正整数
		var type1="^-[0-9]*[0-9][0-9]*$"  //判断输入是否为负整数
		var re = new RegExp(type);
		var re1=new RegExp(type1);
		if(($("#infMinMinutes").val().match(re)==null)||($("#infMaxMinutes").val().match(re)==null)||($("#minrxqual").val().match(re)==null)||($("#numofinfrxqual").val().match(re)==null)||
			($("#minleisuretime").val().match(re)==null)||($("#maxleisuretime").val().match(re)==null)||($("#NotKPSTCHthreshold").val().match(re)==null)||($("#KPSTCHthreshold").val().match(re)==null)||
			($("#Onepointthreshold").val().match(re)==null)||($("#Otherchannelthreshold").val().match(re)==null)||($("#Servicelevel1").val().match(re)==null)||($("#Servicelevel2").val().match(re)==null)||
			($("#Servicelevel3").val().match(re)==null)||($("#Minimumlevel").val().match(re1)==null))
		{
			$.messager.alert("系统提示","请输入正确的整数！");
			 return;
		}
		 $.post("${pageContext.request.contextPath}/interferencequery/insertinfconfig.do",{InfMinMinutes:$("#infMinMinutes").val(),InfMaxMinutes:$("#infMaxMinutes").val(),
			 Minrxqual:$("#minrxqual").val(),Numofinfrxqual:$("#numofinfrxqual").val(),Minleisuretime:$("#minleisuretime").val(),Maxleisuretime:$("#maxleisuretime").val(),
			 NotKPSTCHthreshold:$("#NotKPSTCHthreshold").val(),KPSTCHthreshold:$("#KPSTCHthreshold").val(),Onepointthreshold:$("#Onepointthreshold").val(),Otherchannelthreshold:$("#Otherchannelthreshold").val(),
			 Servicelevel1:$("#Servicelevel1").val(),Servicelevel2:$("#Servicelevel2").val(),Servicelevel3:$("#Servicelevel3").val(),Minimumlevel:$("#Minimumlevel").val(),
			 BCCH:$("#BCCH").val(),TCH:$("#TCH").val(),BLOCK:$("#BLOCK").val(),INTERMODULATION:$("#INTERMODULATION").val(),SPURIOUS:$("#SPURIOUS").val(),OTHER:$("#OTHER").val()},function(result){
				if(result.success){
					 $.messager.alert("系统提示","参数应用成功！");
				}else{
					$.messager.alert("系统提示","参数应用失败！");
				}
			},"json");
			
	}


</script>
</head>
<body>
<div class="easyui-window" title="干扰分析参数配置" data-options="modal:false,closable:false,minimizable:false,maximizable:false,collapsible:false" style="width:500px;height:850px;padding:10px;">
	<form id="fm" action="" method="post">
		<table cellpadding="6px" url="" fit="true" >
			<tr align="center">
				<th colspan="3" style="padding-bottom: 10px"><big>干扰参数配置</big></th>
			</tr>
			<tr >
				<td>干扰最小时长：</td>
				<td style="text-decoration: none;text-align:center">
				    <input type="text" id="infMinMinutes" name="infMinMinutes"  class="easyui-validatebox" values="" style="text-align:center;width:200px;" required="true"/></td>
				<td>分</td>
			</tr>
			<tr>
				<td>干扰最长时长：</td>
				<td><input type="text" id="infMaxMinutes" name="infMaxMinutes" class="easyui-validatebox" values="" style="text-align:center;width: 200px" required="true"/></td>
				<td>分</td>
			</tr>
			<tr>
				<td>干扰最小通话质量：</td>
				<td>
					<input type="text" id="minrxqual" name="minrxqual" class="easyui-validatebox"  values="" style="text-align:center;width: 200px" required="true"/>
				</td>
			</tr>
			<tr>
				<td>最小测量报告干扰数目：</td>
				<td>
                     <input type="text" id="numofinfrxqual" name="numofinfrxqual" class="easyui-validatebox" values="" style="text-align:center;width: 200px" required="true"/>
				</td>
			</tr>
			<tr>
				<td>闲时开始时间：</td>
				<td><input type="text" id="minleisuretime" name="minleisuretime" class="easyui-validatebox" values="" style="text-align:center;width: 200px" required="true"/></td>
				<td>时</td>
			</tr>
			<tr>
				<td>闲时结束时间：</td>
				<td><input type="text" id="maxleisuretime" name="maxleisuretime" class="easyui-validatebox" values="" style="text-align:center;width: 200px" required="true"/></td>
				<td>时</td>
			</tr>
			<tr>
				<td>TCH信道阈值(非KPS)：</td>
				<td><input type="text" id="NotKPSTCHthreshold" name="NotKPSTCHthreshold" class="easyui-validatebox" values="" style="text-align:center;width: 200px" required="true"/></td>
				<td>dB</td>
			</tr>
			<tr>
				<td>TCH信道阈值(KPS)：</td>
				<td><input type="text" id="KPSTCHthreshold" name="KPSTCHthreshold" class="easyui-validatebox" values="" style="text-align:center;width: 200px" required="true"/></td>
				<td>dB</td>
			</tr>
			<tr>
				<td>单点干扰阈值：</td>
				<td><input type="text" id="Onepointthreshold" name="Onepointthreshold" class="easyui-validatebox" values="" style="text-align:center;width: 200px" required="true"/></td>
				<td>dB</td>
			</tr>
			<tr>
				<td>其他信道阈值：</td>
				<td><input type="text" id="Otherchannelthreshold" name="Otherchannelthreshold" class="easyui-validatebox" values="" style="text-align:center;width: 200px" required="true"/></td>
				<td>dB</td>
			</tr>
			<tr>
				<td>业务等级1延时时间：</td>
				<td><input type="text" id="Servicelevel1" name="Servicelevel1" class="easyui-validatebox" values="" style="text-align:center;width: 200px" required="true"/></td>
				<td>分</td>
			</tr>
			<tr>
				<td>业务等级2延时时间：</td>
				<td><input type="text" id="Servicelevel2" name="Servicelevel2" class="easyui-validatebox" values="" style="text-align:center;width: 200px" required="true"/></td>
				<td>分</td>
			</tr>
			<tr>
				<td>业务等级3延时时间：</td>
				<td><input type="text" id="Servicelevel3" name="Servicelevel3" class="easyui-validatebox" values="" style="text-align:center;width: 200px" required="true"/></td>
				<td>分</td>
			</tr>
			<tr>
				<td>干扰电平阈值：</td>
				<td><input type="text" id="Minimumlevel" name="Minimumlevel" class="easyui-validatebox" values="" style="text-align:center;width: 200px" required="true"/></td>
				<td>dBm</td>
			</tr>
			<tr>
				<td>BCCH同邻频干扰名称：</td>
				<td><input type="text" id="BCCH" name="BCCH" class="easyui-validatebox" values="" style="text-align:center;width: 200px" required="true"/></td>
				<td> </td>
			</tr>
			<tr>
				<td>TCH同邻频干扰名称：</td>
				<td><input type="text" id="TCH" name="TCH" class="easyui-validatebox" values="" style="text-align:center;width: 200px" required="true"/></td>
				<td> </td>
			</tr>
	
			<tr>
				<td>测量报告干扰名称：</td>
				<td><input type="text" id="BLOCK" name="BLOCK" class="easyui-validatebox" values="" style="text-align:center;width: 200px" required="true"/></td>
				<td> </td>
			</tr>
			<tr>
				<td>互调干扰名称：</td>
				<td><input type="text" id="INTERMODULATION" name="INTERMODULATION" class="easyui-validatebox" values="" style="text-align:center;width: 200px" required="true"/></td>
				<td> </td>
			</tr>
			<tr>
				<td>杂散干扰名称：</td>
				<td><input type="text" id="SPURIOUS" name="SPURIOUS" class="easyui-validatebox" values="" style="text-align:center;width: 200px" required="true"/></td>
				<td> </td>
			</tr>
			<tr>
				<td>其他类型干扰名称：</td>
				<td><input type="text" id="OTHER" name="OTHER" class="easyui-validatebox" values="" style="text-align:center;width: 200px" required="true"/></td>
				<td> </td>
			</tr>
			<tr>
				<td colspan="2"></td>
			</tr>
			<c:if test="${currentMemberShip.group.name=='管理员' }">
			<tr>
				<td>	
					
				</td>
				<td>
					<a href="javascript:submitData1()" class="easyui-linkbutton" >应用</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<a href="javascript:refresh1()" class="easyui-linkbutton" >刷新</a>
				</td>
			</tr>
			</c:if>
		</table>
	</form>
</div>
</body>
</html>